import { bannerList } from "@/request/api"

const state = {
    bannerlist: []
}

const getters = {
    getBannerList(state) {
        return state.bannerlist
    }
}

const mutations = {
    REQ_BANNER(state, payload) {
        state.bannerlist = payload
    }
}

const actions = {
    changeBannerAction({ commit }) {
        bannerList().then(res => {
            console.log(res, '轮播图列表');
            commit('REQ_BANNER', res.list)
        })
    }
}

export default {
    state,
    getters,
    mutations,
    actions,
    namespaced: true
}